package com.opengroupe.entities;

// Generated 31 juil. 2012 15:46:15 by Hibernate Tools 3.4.0.CR1

import static javax.persistence.GenerationType.IDENTITY;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Candidat generated by hbm2java
 */
@Entity
@Table(name = "candidat", catalog = "qrh")
@NamedQueries(value = {
	@NamedQuery(name="findByEmail", query="SELECT c FROM Candidat c WHERE c.emailCandidat= ?1"),
	@NamedQuery(name="findByNomPrenom", query="SELECT c FROM Candidat c WHERE c.nomCandidat= ?1 AND c.prenomCandidat= ?2")
})
public class Candidat implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 127938226004955304L;
	private Integer idCandidat;
	private String nomCandidat;
	private String prenomCandidat;
	private String emailCandidat;
	private String telephoneCandidat;
	private Set<CandidatReponseQuestion> candidatReponseQuestions = new HashSet<CandidatReponseQuestion>(
			0);

	public Candidat() {
	}

	public Candidat(String nomCandidat, String prenomCandidat,
			String emailCandidat, String telephoneCandidat,
			Set<CandidatReponseQuestion> candidatReponseQuestions) {
		this.nomCandidat = nomCandidat;
		this.prenomCandidat = prenomCandidat;
		this.emailCandidat = emailCandidat;
		this.telephoneCandidat = telephoneCandidat;
		this.candidatReponseQuestions = candidatReponseQuestions;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "idCandidat", unique = true, nullable = false)
	public Integer getIdCandidat() {
		return this.idCandidat;
	}

	public void setIdCandidat(Integer idCandidat) {
		this.idCandidat = idCandidat;
	}

	@Column(name = "nomCandidat", length = 100)
	public String getNomCandidat() {
		return this.nomCandidat;
	}

	public void setNomCandidat(String nomCandidat) {
		this.nomCandidat = nomCandidat;
	}

	@Column(name = "prenomCandidat", length = 100)
	public String getPrenomCandidat() {
		return this.prenomCandidat;
	}

	public void setPrenomCandidat(String prenomCandidat) {
		this.prenomCandidat = prenomCandidat;
	}

	@Column(name = "emailCandidat", length = 100, unique=true)
	public String getEmailCandidat() {
		return this.emailCandidat;
	}

	public void setEmailCandidat(String emailCandidat) {
		this.emailCandidat = emailCandidat;
	}

	@Column(name = "telephoneCandidat", length = 10, unique=true)
	public String getTelephoneCandidat() {
		return this.telephoneCandidat;
	}

	public void setTelephoneCandidat(String telephoneCandidat) {
		this.telephoneCandidat = telephoneCandidat;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "candidat")
	public Set<CandidatReponseQuestion> getCandidatreponsequestions() {
		return this.candidatReponseQuestions;
	}

	public void setCandidatreponsequestions(
			Set<CandidatReponseQuestion> candidatReponseQuestions) {
		this.candidatReponseQuestions = candidatReponseQuestions;
	}

}
